<div ng-include="'tpl/menu.tpl.html'" ng-controller="MgtMenuController"></div>  

<div>
  <alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">{{alert.msg}}</alert>
</div>

<div class="container">
  <div class="row">
    <div class="col-xs-12">
      <div class="table-responsive">
        <table class="table table-hover">
          <thead>
            <tr>
              <th>#</th>
              <th>标题</th>
              <th>主持人</th>
              <th>创建时间</th>
              <th>开始时间</th>
              <th>状态</th>
              <th>快捷操作</th>
            </tr>
          </thead>
          <tbody>
            <tr ng-repeat="topic in topics" >
              <td>
                {{$index}}
              </td>             
              <td>
              <span ng-show="topic.isHomePage" class="glyphicon glyphicon-star" aria-hidden="true"></span>
              
              <a ng-href="#!/topic/{{topic.tid}}">{{topic.title}}</a></td>
              <td>{{topic.user}}</td>
              <td>{{topic.created |date:'yyyy年MM月dd日 HH:mm'}}</td>
              <td><a ng-href="#!/mgt/topic/{{topic.tid}}/enroll">{{topic.startdate |date:'yyyy年MM月dd日 HH:mm'}}</a></td>
              <td ng-class="{success:topic.valid}">{{topic.valid}}</td>
              <td>
                 <button ng-click="toHomePage(topic)" type="button" class="btn btn-primary btn-xs">  <span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span>
                 </button>

                 <button ng-click="ban(topic)" type="button" class="btn btn-primary btn-xs">  <span 
                  ng-class="topic.banClassName"  
                  class="glyphicon " aria-hidden="true"></span>
                 </button>

                 <button ng-click="remove(topic)" type="button" class="btn btn-primary btn-xs">  <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
                 </button>                                  
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>

